#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
char* my_strncpy(char* arr,char* arr2,size_t sz){
	assert(arr && arr2);
	char* cmp = arr;
	int z = 0;
	for (int n = 0; n < sz; n++)
	{
		if (*arr2 == '\0')
		{
			for (; z < sz; z++)
			{
				*arr = '\0';
				arr++;
			}
			return cmp;
		}
		else
		{
			*arr++ = *arr2++;
			z++;
		}
	}
	return cmp;
}
int main()
{
	char arr[] = "abcdefg";
	char arr2[] = "ghi";
	printf("%s", my_strncpy(arr, arr2, 6));
}